/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.msk.wlhy.service;

import com.msk.sys.service.CrudService;
import com.msk.wlhy.domain.Information;
import com.msk.wlhy.mapper.InformationDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>[]</p>
 * <p>作者：shic</p>
 * <p>邮箱：shic@xiangyou.com</p>
 * <p>创建时间： 2019-04-01 </p>
 * <p>类说明：提示消息Service </p>
 * <p>修改记录：</p>
 */
@Service
@Transactional(readOnly = true)
public class InformationService extends CrudService<InformationDao, Information> {

	public Information get(String id) {
		return super.get(id);
	}
	
	public List<Information> findList(Information information) {
		return super.findList(information);
	}
	
	@Transactional(readOnly = false)
	public void save(Information information) {
		super.save(information);
	}
	
	/**
	 * 查询所有用户未读消息
	 * @param information
	 * @return
	 */
	public Long  getCount(Information information){
		
		return dao.getCount(information);
		
	};
	
	
	@Transactional(readOnly = false)
	public void delete(Information information) {
		super.delete(information);
	}
	
	@Transactional(readOnly = false)
	public int deleteIds(String[] ids) {
		int result = 0;
		for (String id : ids) {
			super.delete(new Information(id));
			result ++;
		}
		return result;
	}

	@Transactional(readOnly = false)
	public int updateInformation(String userId){
		return dao.updateInformation(userId);
	}

}